package ttu.idu0080.ryhm103_transportOrderService;

import java.util.Random;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlType;

@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "TransportOrder", propOrder = {
    "trackingNr"
})
public class TransportOrder {
	protected String trackingNr=generateString(new Random(), "RT1234567890E", 10);
	
	public String getTrackingNr() {
		return trackingNr;
	}


	public static String generateString(Random rng, String characters, int length)
	{
	    char[] text = new char[length];
	    for (int i = 0; i < length; i++)
	    {
	        text[i] = characters.charAt(rng.nextInt(characters.length()));
	    }
	    return new String(text);
	}
}
